<template>
  <view class="box">
    <!-- <view class="item" @tap="goDetail(0)">
			<view class="flex flex-j-b">
				<view class="flex">
					<view style="font-size: 36upx;">首次建卡产检</view>
					<image :src="tag1" mode="widthFix" style="width: 120upx;"></image>
				</view>
				<view>已上传</view>
			</view>
			<view class="uni-item-line" style="padding: 20upx 0;">09.18-11.12</view>
			<view class="flex flex-al-c" style="padding: 30upx 0 0;">
				<u-tag text="重点检查" type="success" bg-color="#fff" 
					color="#999" border-color="#999" style="margin-right: 30upx;"/>
				<view> 建档 NT</view>
			</view>
		</view> -->
    <view
      class="item"
      v-for="(v, index) in list"
      :key="v.id"
      @tap="goDetail(v)"
    >
      <view class="flex flex-j-b">
        <view class="flex">
          <view style="font-size: 36upx">{{ v.planName }}</view>
          <image
            v-if="v.checkType == '1'"
            :src="tag1"
            mode="widthFix"
            style="width: 120upx"
          ></image>
          <image
            v-if="v.checkType == '0' || v.checkType == '2'"
            :src="tag2"
            mode="widthFix"
            style="width: 120upx"
          ></image>
        </view>
        <view>已上传</view>
      </view>
      <view class="uni-item-line" style="padding: 20upx 0">{{
        v.planTime
      }}</view>
      <view class="flex flex-al-c" style="padding: 30upx 0 0">
        <!-- <u-tag :text="v.planRemark" type="success" bg-color="#fff" 
					color="#999" border-color="#999" style="margin-right: 30upx;"/> -->
        <view> {{ v.planGoal }}</view>
      </view>
    </view>
    <!-- <view class="item" @tap="goDetail(1)">
			<view class="flex flex-j-b">
				<view class="flex">
					<view style="font-size: 36upx;">孕14-19周</view>
					<image :src="tag2" mode="widthFix" style="width: 120upx;"></image>
				</view>
				<view>已上传</view>
			</view>
			<view class="uni-item-line" style="padding: 20upx 0;">09.18-11.12</view>
			<view class="flex flex-al-c" style="padding: 30upx 0 0;">
				<u-tag text="重点检查" type="success" bg-color="#fff" 
					color="#999" border-color="#999" style="margin-right: 30upx;"/>
				<view> 建档 NT</view>
			</view>
		</view> -->
  </view>
</template>

<script>
export default {
  data() {
    return {
      tag1:
        "../../../static/img/65ff008b0ea040578f44d897bb1ce281.jpg", // 已完成
      tag2:
        "../../../static/img/37233eda18584b35a8ba7bb11381d5ab.jpg", // 未完成

      list: [],
    };
  },
  methods: {
    // 孕妇待办
    getPrenatal() {
      let self = this;
      uni.showLoading({ title: "加载中", mask: true });
      setTimeout((s) => {
        uni.hideLoading();
      }, 5000);
      this.config
        .get("/agency/planGravidPrenatalCheck/getPlanGravidPrenatalCheck", {})
        .then((res) => {
          uni.hideLoading();
          if (res.data.code === 200) {
            self.list = res.data.data;
          } else {
            if (res.data.code == "-201") {
              self.config.handleError(res.data);
            } else {
              uni.showToast({
                title: self.config.handleError(res.data),
                icon: "none",
              });
            }
          }
        });
    },
    goDetail(v) {
      uni.navigateTo({
        url: "/pages/main/pregnant/backlog-detail?id=" + v.id,
      });
    },
  },
  mounted() {
    this.getPrenatal();
  },
};
</script>

<style lang="less" scoped>
.box {
  width: 100%;
  height: 100%;
  background-color: #eee;
  padding-top: 1upx;
}
.item {
  margin: 20upx;
  padding: 30upx;
  background-color: #fff;
}
</style>
